#ifndef __VTOR_DEQUE_H__
#define __VTOR_DEQUE_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "vtor_elec_module_config.h"

#ifdef __VTOR_DEQUE__

#include "stdio.h"
#include "stdint.h"
//参考c++ deque，完成VtorDeque相关函数

typedef struct
{
    // 外缓存保留数据
    uint8_t* buf;
    uint16_t bufSize;

    uint16_t frontIdx;
    uint16_t backIdx;
    uint16_t charCnt;
} VtorDeque;


void VtorDeque_OverflowCallback(VtorDeque* que);

void VtorDeque_PushBufBack(VtorDeque* que, uint8_t* inBuf, int16_t inLen);
int16_t VtorDeque_PopBufFront(VtorDeque* que, uint8_t* outBuf, int16_t expOutLen);
int16_t VtorDeque_PopLineFront(VtorDeque* que, uint8_t* outBuf, int16_t expOutLen);

void VtorDeque_Test1(void);
void VtorDeque_Test2(void);
void VtorDeque_Init(void);

#endif // __VTOR_DEQUE__

#ifdef __cplusplus
}
#endif

#endif // __VTOR_DEQUE_H__

